package cn.iocoder.yudao.module.erp.dal.mysql.exchange;

import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.erp.dal.dataobject.exchange.ErpExchangeOrderItemDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper;

import java.util.Collection;
import java.util.List;

/**
 * ERP 旧料兑换订单项 Mapper
 */
@Mapper
public interface ErpExchangeOrderItemMapper extends BaseMapperX<ErpExchangeOrderItemDO> {

    default List<ErpExchangeOrderItemDO> selectListByOrderId(Long orderId) {
        return selectList(new LambdaQueryWrapper<ErpExchangeOrderItemDO>()
                .eq(ErpExchangeOrderItemDO::getOrderId, orderId));
    }

    default List<ErpExchangeOrderItemDO> selectListByOrderIds(Collection<Long> orderIds) {
        return selectList(new LambdaQueryWrapper<ErpExchangeOrderItemDO>()
                .in(ErpExchangeOrderItemDO::getOrderId, orderIds));
    }

    default int deleteByOrderId(Long orderId) {
        return delete(new LambdaQueryWrapper<ErpExchangeOrderItemDO>()
                .eq(ErpExchangeOrderItemDO::getOrderId, orderId));
    }

} 